// api/modules/user.js
import { request } from '../http'

// 获取用户列表
export const getUsers = (params = {}) => {
  return request.get('/users', params)
}

// 获取用户详情
export const getUserById = (id) => {
  return request.get(`/users/${id}`)
}

// 更新用户信息
export const updateUser = (id, userData) => {
  return request.put(`/users/${id}`, userData)
}

// 删除用户
export const deleteUser = (id) => {
  return request.delete(`/users/${id}`)
}

// 更新用户头像
export const updateAvatar = (file) => {
  return request.upload('/users/avatar', file)
}

// 修改密码
export const changePassword = (data) => {
  return request.post('/users/change-password', data)
}